package com.baidu.emus;

public enum CloudType implements BaseEnum<Integer> {
	signCount(0, "云签到总次数" );

	private int code;

	private String description;

	private CloudType(int _code, String description) {
		this.code = _code;
		this.description = description;
	}

	public Integer getCode() {
		return this.code;
	}

	public String getDescription() {
		return description;
	}

	@Override
	public String toString() {

		return String.valueOf(this.code);

	}

	// 通过属性获取对象
	public static CloudType getErrorCode(int code) {

		for (CloudType obj : CloudType.values()) {
			if (code == obj.getCode()) {

				return obj;
			}
		}

		return null;

	}

	public static String getName(int code) {

		for (CloudType obj : CloudType.values()) {
			if (code == obj.getCode()) {

				return obj.name();
			}
		}

		return null;

	}

	public static String getDescription(int code) {

		for (CloudType obj : CloudType.values()) {
			if (code == obj.getCode()) {

				return obj.getDescription();
			}
		}
		return null;

	}
}
